<template>
  <div>
    <mySearch />
    <mySwiper :images="images" />
    <myCategory :category="category" :advertesPicture="advertesPicture"/>
    <!-- <myCategory :getCategory="[category,advertesPicture]"/> -->
    <myRecommend :recommend="recommend" />
    <my-one-floor :floors="floor1" :floorName="floorName.floor1"/>
    <my-one-floor :floors="floor2" :floorName="floorName.floor2"/>
    <my-one-floor :floors="floor3" :floorName="floorName.floor3"/>
    <myHotGoods :hotGoods="hotGoods"/>
  </div>
</template>

<script>

import mySearch from "./components/mySearch"
import mySwiper from "./components/mySwiper"
import myCategory from "./components/myCategory"
import myRecommend from "./components/myRecommend"
import myOneFloor from "./components/myOneFloor"
import myHotGoods from "./components/myHotGoods"
// import * as indexRequest from "@/commonAPI/api.js"
import { GetData } from "@/commonAPI/api.js"

export default {
  data() {
    return {
      images:"",
      category:"",
      advertesPicture:"",
      recommend:"",
      floor1:"",
      floor2:"",
      floor3:"",
      floorName:{},
      hotGoods:"",
    }
  },
  methods:{
    async DataUrl(){
      var that = this
      // let info = await indexRequest.GetData(url)
      let res = await GetData("/goods/getIndexInfo")
      // window.console.log(res)
      let info = res.data.message.data
      // window.console.log(info)
      that.images = info.slides
      that.category = info.category
      that.advertesPicture = info.advertesPicture.PICTURE_ADDRESS
      that.recommend = info.recommend
      that.floor1 = info.floor1
      that.floor2 = info.floor2
      that.floor3 = info.floor3
      that.floorName = info.floorName
      that.hotGoods = info.hotGoods
    }
  },
  created(){
    var that = this
    that.DataUrl()
  },
  components:{
    mySearch,
    mySwiper,
    myCategory,
    myRecommend,
    myOneFloor,
    myHotGoods
  }
};
</script>

<style lang="scss" scoped>
    
</style>